Indentation in Python
Indentation in Python refers to the spaces (or tabs) at the beginning of a line of code. Unlike many other programming languages, indentation in Python is not just for readability — it is a part of the syntax.
Python uses indentation to group statements together.
if age >= 18:
print("You are eligible to vote")
print("Please carry your ID")
Both print statements belong to the if block because they are indented.
Without Indentation, Code Will Not Run
if age >= 18:
print("Eligible")
Logical Errors Can Occur Due to Wrong Indentation.